import { Entity, Column, PrimaryGeneratedColumn, UpdateDateColumn, ManyToOne, JoinColumn } from 'typeorm';
import { AdPosition } from "./ad_position.entities";
import { ApiProperty} from '@nestjs/swagger';
import { IsOptional } from 'class-validator';
import { Goods } from './goods.entity';

@Entity()
export class Footprint {
  @PrimaryGeneratedColumn({type: 'int'})
  id: number;

  @Column({type: 'int'})
  user_id: number;

  @IsOptional()
  @ApiProperty()
  @Column({type: 'int'})
  goods_id: number;

  @Column({type: 'int'})
  add_time: number;

  @Column({type: 'int', comment: "转发人"})
  referrer: number;

  @ManyToOne(type => Goods, goods => goods.footprint)
  @JoinColumn({
    name:"goods_id"
  })
  goods:Goods
}
